package com.example.demo.durable;

import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class DurableQueueConfig {

    public  final static String DURABLE="is_durable";//持久化
    public  final static String NOT_DURABLE="not_durable";//不持久化
    public  final static String ACK_QUEUE="ACK_QUEUE";//不持久化


    @Bean
    public Queue durable(){
        return new Queue(DURABLE,true);
    }

    @Bean
    public Queue notDurable(){
        return new Queue(NOT_DURABLE,false);
    }

    @Bean
    public Queue ackQueue(){
        //需要应答的持久化消息
        return new Queue(ACK_QUEUE,true);
    }
}
